![]() |
InitGDevice |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Initializes a GDevice structure.
void InitGDevice ( SInt16 qdRefNum, SInt32 mode, GDHandle gdh );
Reference number of the graphics device. System software sets this number at system startup time for most graphics devices.
The device configuration mode. Used by the screen driver, this value sets the pixel depth and specifies color or black and white.
The handle, returned by the NewGDevice function, to the GDevice structure to be initialized.
The InitGDevice function sets the graphics device whose driver has the reference number specified in the gdRefNum parameter to the mode specified in the mode parameter. The InitGDevice function then fills out the GDevice structure, previously created with the NewGDevice function, to contain all information describing that mode.
The mode parameter determines the configuration of the device. Possible modes for a device are determined by interrogating the video device’s ROM through Slot Manager functions. The information describing the device’s mode is primarily contained in the video device’s ROM. If the video device has a fixed color table, then that table is read directly from the ROM. If the video device has a variable color table, then InitGDevice uses the default color table defined in a 'clut' resource, contained in the System file, that has a resource ID equal to the video device’s pixel depth.
In general, your application should never need to call InitGDevice. All video devices are initialized at start time, and users change modes through the Monitors control panel.
If your program uses NewGDevice to create a graphics device without a driver, InitGDevice does nothing; instead, your application must initialize all fields of the GDevice structure. After your application initializes the color table for the GDevice structure, call the Color Manager function MakeITable to build the inverse table for the graphics device.
The InitGDevice function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)